package com.xpc.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xpc.config.StingToDate;
import com.xpc.mapper.AccountMapper;
import com.xpc.mapper.AffairInfoMapper;
import com.xpc.pojo.Account;
import com.xpc.pojo.Affair;
import com.xpc.pojo.AffairContent;
import com.xpc.pojo.vo.AffairInfo;
import com.xpc.pojo.vo.AffairUrlInfo;
import com.xpc.pojo.vo.UrlList;
import com.xpc.service.IAccountService;
import com.xpc.service.IAffairUrlInfoService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

/**
 * Project：UniversityGradeAdministrationSystem
 * Date：2022/6/14
 * Time：18:47
 * Description：TODO
 *
 * @author 南北辰的键盘
 * @version 1.0
 */
@Service("affairUrlInfoServiceImpl")
//public class AffairUrlInfoServiceImpl extends ServiceImpl< AffairUrlInfoM,  AffairUrlInfo> implements IAccountService {
public class AffairUrlInfoServiceImpl implements IAffairUrlInfoService {

    @Autowired
    AffairInfoMapper affairInfoMapper;
    @Autowired
    AffairContentServiceImpl affairContentService;
    @Autowired
    AffairServiceImpl affairService;
    @Autowired
    IAccountService iAccountService;

    @Override
    public List<AffairUrlInfo> selectLike(AffairUrlInfo affairUrlInfo) {

        return null;
    }

//    @Override
//    public boolean save(String[] strings) {
//        StingToDate stingToDate = null;
//        Affair affair = null;
//
//
//
//        AffairContent affairContent = null;
//        // 内容
//        affairContent.setTheme(strings[4]);
//        affairContent.setParticular(strings[5]);
//        boolean saveContent = affairContentService.save(affairContent);
//        System.out.println(affairContent.getId());
//        if (!saveContent){
//            return saveContent;
//        }
//
//        affair.setAClId(Integer.valueOf(strings[0]));
//        affair.setACoId(affairContent.getId());
//        affair.setPriority(Integer.valueOf(strings[6]));
//        affair.setUrl(strings[12]);
//        affair.setFUrl(strings[13]);
//        affair.setStartTime(stingToDate.ymdhms(strings[1]));
//        affair.setEndTime(stingToDate.ymdhms(strings[2]));
//        if (null == strings[3] || "" == strings[3] || "null" == strings[3]){
//            Subject subject = SecurityUtils.getSubject();
//            String principal = (String) subject.getPrincipal();
//            affair.setCreator(iAccountService.getById(principal).getUserId());
//        }else {
//            affair.setCreator(Long.valueOf(strings[3]));
//        }
//        Date d = new Date();
//        affair.setCreateTime(d);
//        affair.setStart(1);
//        boolean saveAffair = affairService.save(affair);
//        if(!saveAffair){
//            return saveAffair;
//        }
//
//        return true;
//    }



    /**
     * ====================================
     * ============以下自动生成=============
     * ====================================
     * -------作废--------
     */


    @Override
    public boolean saveBatch(Collection<AffairUrlInfo> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<AffairUrlInfo> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<AffairUrlInfo> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(AffairUrlInfo entity) {
        return false;
    }

    @Override
    public AffairUrlInfo getOne(Wrapper<AffairUrlInfo> queryWrapper, boolean throwEx) {
        return null;
    }

    @Override
    public Map<String, Object> getMap(Wrapper<AffairUrlInfo> queryWrapper) {
        return null;
    }

    @Override
    public <V> V getObj(Wrapper<AffairUrlInfo> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }

    @Override
    public BaseMapper<AffairUrlInfo> getBaseMapper() {
        return null;
    }

    @Override
    public Class<AffairUrlInfo> getEntityClass() {
        return null;
    }


}
